<template>
  <div id="one" ref="one"></div>
  <div id="two"></div>
  <button @click="closeOne">1</button>
</template>

<script setup lang="ts">
import { ref } from 'vue';
const one = ref(null);


function closeOne() {
  if (one.value) {
    console.log(one.value);
    one.value.style.display = 'none';
  }
}
</script>

<style scoped>
div {
  width: 200px;
  height: 200px;
}

#one {
  background-color: red;
}

#two {
  background-color: blue;
}
</style>
